<?php
/*

This templated is loaded from one of the following locations, listed in order below: 

    - Your theme directory's "woocommerce/emails" subdirectory.

    - In Post-Purchase Follow-up plugin's "emails" subdirectory

*/
?>

<?php if ( !defined( 'ABSPATH' ) ) die; ?>

<?php 

global $cart_items, $followup_content, $woocommerce, $email_heading;

$currency_symbol = get_woocommerce_currency_symbol();

?>

<?php do_action( 'woocommerce_email_header', $email_heading ); ?>

<p><?php _e( "Your order is complete and your gift certificates are now available for use:", 'woocommerce' ); ?></p>

<?php do_action( 'woocommerce_email_before_cart_items_table', $cart_items, false ); ?>


<?php 

if ( is_array( $cart_items ) && count ( $cart_items) > 0 ) { 

	ob_start();

?>

	<table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
		<thead>
			<tr>
				<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php _e('Item', 'woocommerce'); ?></th>
				<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php _e('Price / Value', 'woocommerce'); ?></th>
				<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php _e('Quantity', 'woocommerce'); ?></th>
				<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php _e('Subtotal', 'woocommerce'); ?></th>
			</tr>
		</thead>
		<tbody>

			<?php foreach( $cart_items as $cid ) { ?>

				<tr>
					<td><?php echo $cid['name'] ?></td>
					<td><?php echo $currency_symbol . $cid['price'] ?></td>
					<td><?php echo $cid['qty'] ?></td>
					<td><?php echo $cid['item_total'] ?></td>
				</tr>

			<?php } ?>

		</tbody>

	</table>

	<div style="clear:both;"></div>

	<p><?php _e( 'Visit the store and login to continue shopping or checkout!', 'woocommerce' ) ?></p>

<?php 
	$cart_contents = ob_get_contents();

	ob_end_clean();

	$followup_content = str_replace( '{cart_contents}', $cart_contents, $followup_content );

} 
?>

<?php echo $followup_content ?>

<div style="clear:both;"></div>

<?php do_action( 'woocommerce_email_footer' ); ?>